import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://www.baidu.com/")
driver.implicitly_wait(15)
driver.maximize_window()

driver.find_element(By.NAME,"wd").send_keys("王长帅不是很帅的长帅网")
driver.find_element(By.ID,"su").click()
win1 = 'window.scrollBy(0,1500)' #Y 轴向下1500像素
win2 = "window.scrollBy(0,-500)" # Y 轴向上500像素


time.sleep(2)
driver.execute_script(win1)
time.sleep(2)
driver.execute_script(win2)



